﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CalculatingASumOfASequence
{
    class Program
    {
        static void Main(string[] args)
        {
            double previuosSum = 0.0;
            double sum = 1.0;
            

            for (double index = 2; sum - previuosSum > 0.0001; index++)
            {
                previuosSum = sum;
                if (index % 2 == 1)
                {
                    sum -= 1.0/ (index);
                }
                else
                {
                    sum += 1.0 / (index);
                }

            }
            Console.WriteLine(sum);

        }
    }
}
